package com.jams.goodox.activity.serve.enterprise;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.github.lzyzsd.library.BridgeWebView;
import com.jams.goodox.BaseFragment;
import com.jams.goodox.R;
import com.jams.goodox.utils.StringUtils;
import com.jams.goodox.utils.WebViewUtils;

import butterknife.Bind;
import butterknife.ButterKnife;


/**
 * 作者：dell on 2017/5/19 16:35
 * 功能描述: 企业政策详情
 */

public class EnterprisePolicyDetailFragment extends BaseFragment {


    @Bind(R.id.webView)
    BridgeWebView policyWebView;
    /**
     * 获得的webview的内容
     */
    private String webViewContent;
    private  static final String ARG_PARAM1 = "param1";
   // private static final String ARG_PARAM2 = "param2";
    /**
     * 判断是否是银行贷款或者是企业理财的入口
     */
  //  public static final String LEND_OR_FINANCIAL ="LEND_OR_FINANCIAL";

    public EnterprisePolicyDetailFragment() {
        // Required empty public constructor
    }

    public static EnterprisePolicyDetailFragment newInstance(String param1) {
        EnterprisePolicyDetailFragment fragment = new EnterprisePolicyDetailFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            webViewContent = StringUtils.newString(getArguments().getString(ARG_PARAM1));
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.bridge_web_view, container, false);
        ButterKnife.bind(this, view);
        //webview展示
        WebViewUtils.initForPolicyFunnyTime(policyWebView, webViewContent);
        return view;
    }



    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }

}
